# Maintainer: schuay <jakob.gruber@gmail.com>
# Contributor: Ivan Sichmann Freitas <ivansichfreitas at gmail dot com>
# Contributor: Laszlo Papp <djszapi2 at gmail dot com>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
# Contributor: Vladimir Cerny <blackvladimir@gmail.com>
# Contributor: 4javier <4javieregATgmailDOTcom>

pkgname=avr-gdb
_pkgname=gdb
pkgver=7.5.1
pkgrel=1
pkgdesc="The GNU Debugger for AVR"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gdb/"
license=('GPL3')
depends=('python2')
options=('!libtool')
source=(http://ftp.gnu.org/gnu/gdb/${_pkgname}-${pkgver}.tar.bz2)

build() {
  cd ${srcdir}/${_pkgname}-${pkgver}

  unset LDFLAGS
  export CFLAGS="-O2 -pipe"
  export CPPFLAGS="-O2 -pipe"
  export CXXFLAGS="$CFLAGS"
    
  ./configure \
    --disable-nls \
    --enable-languages=c,c++ \
    --infodir=/usr/share/info \
    --libdir=/usr/lib \
    --libexecdir=/usr/lib \
    --mandir=/usr/share/man \
    --prefix=/usr \
    --program-prefix=avr- \
    --target=avr \
    --with-python=/usr/bin/python2 \
    --with-system-readline

  make
}

package() {
  cd ${srcdir}/${_pkgname}-${pkgver}

  make DESTDIR=${pkgdir} install

  rm -f ${pkgdir}/usr/lib/libiberty.a
  rm -rf ${pkgdir}/usr/share/info
  rm -rf ${pkgdir}/usr/share/gdb
  rm -rf ${pkgdir}/usr/include/gdb
}

md5sums=('3f48f468b24447cf24820054ff6e85b1')
